package circulate_algorithm_study;

import java.util.*;

public class Reverse_order_Array {


    public static void main(String[] args) {
        int[] arr = new int[100];
        Scanner sc = new Scanner(System.in);
        int count = 0;
        for (int i = 0; i < 100; i++) {
            count++;
            int user = sc.nextInt();
            if (user != 0) {
                arr[i] = user;
            } else {
                arr[i] = 0;
                break;
            }
        }
        int[] arr1 = Arrays.copyOf(arr, count);
//		System.out.println(Arrays.toString(arr1));
        for (int i = count - 2 ; i >= 0; i--) {
            System.out.print(arr1[i] + " ");
            HashMap<Integer, Integer> map = new HashMap<>();
        }
    }

}
